package com.breeze.toolkit.ui;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.breeze.toolkit.util.Util;

import java.util.List;

/**
 * Created by john on 2016/9/1.
 */
public class BaseCommonAdapter<T> extends BaseAdapter {
	private Context mContext;
	private List<T> mList;
	public BaseCommonAdapter(Context context, List<T> list) {
		mContext = context;
		mList = list;
	}

	public List<T> getList() {
		return mList;
	}

	@Override
	public int getCount() {
		return Util.getCount(mList);
	}

	@Override
	public T getItem(int position) {
		return Util.getItem(mList, position);
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		return convertView;
	}
}
